/************************************************
 * Write a C++ program to display the following
 *   a. 5 4 3 2 1
 *   b. 4 3 2 1
 *   c. 3 2 1
 *   d. 2 1
 *   e. 1
 ************************************************/
# include <iostream>
using namespace std;

class Tapering {
  int i;
public:
  Tapering(int num);
  void printMe();
};

//constructor
Tapering::Tapering(int num) {
  i = num;
}

void Tapering::printMe() {
  int j, k;
	char c = 97; //ASCII for character a
  for(j = i; j > 0; j--) {
		cout << c++ << ". "; //Print current character and move to next
    for(k = j; k > 0; k--) {
      cout << k << " "; //Prints a row
    }
    cout << endl; //Prints a line break
  }
}


int main() {
  int num;
  cout << "Enter your number: ";
  cin >> num;
  Tapering tapering(num);//constructs a tapering for given number
  tapering.printMe();
  return 0;
}

